	package javagame;

import org.newdawn.slick.*;
import org.newdawn.slick.state.*;

public class Game extends StateBasedGame {
	
	public static final String gamename = "Saving Private Pinky";
	public static final int menu = 0;
	public static final int play = 1;
	public static final int options = 2;
	public static final int controls = 3; 
	public static final int game_over = 4;
	public static final int level1 = 5;
	public static final int level2 = 6;
	public static final int level1bonus = 7;
	public static final int level3 = 8;
	public static final int levelboss1 = 9;
	public static final int level5 = 10;
	public static final int level6 = 11;
	public static final int level7 = 12;
	public static final int level7bonus = 13;
	public static final int levelboss2 = 14;
	public static final int finalscene = 15;
	public static final int kraj = 16;
	public static final int threaddemo = 17;
	public static final int survivor = 18;
	public static final int game_over2 = 19;
	
	
	public Game (String gamename) {
		super(gamename);
		this.addState(new Menu (menu));
		this.addState(new Play (play));
		this.addState(new Options (options));
		this.addState(new Controls (controls));
		this.addState(new Level1 (level1));
		this.addState(new Level1Bonus (level1bonus));
		this.addState(new Level2 (level2));
		this.addState(new Level3 (level3));
		this.addState(new LevelBoss1 (levelboss1));
		this.addState(new Level5 (level5));
		this.addState(new Level6 (level6));
		this.addState(new Level7 (level7));
		this.addState(new Level7Bonus (level7bonus));
		this.addState(new LevelBoss2 (levelboss2));
		this.addState(new FinalScene (finalscene));
		this.addState(new GameOver (game_over));
		this.addState(new Kraj (kraj));
		this.addState(new ThreadDemo(threaddemo));
		this.addState(new Survivor(survivor));
		this.addState(new GameOver2 (game_over2));
	}
	
	public void initStatesList (GameContainer gc) throws SlickException {
		this.getState(menu).init(gc, this);
		this.getState(play).init(gc, this);
		this.getState(options).init(gc, this);
		this.getState(controls).init(gc, this);
		this.getState(level1).init(gc, this);
		this.getState(level1bonus).init(gc, this);
		this.getState(level2).init(gc, this);
		this.getState(level3).init(gc, this);
		this.getState(levelboss1).init(gc, this);
		this.getState(level5).init(gc, this);
		this.getState(level6).init(gc, this);
		this.getState(level7).init(gc, this);
		this.getState(level7bonus).init(gc, this);
		this.getState(levelboss2).init(gc, this);
		this.getState(finalscene).init(gc, this);
		this.getState(game_over).init(gc, this);
		this.getState(kraj).init(gc, this);
		this.getState(threaddemo).init(gc, this);
		this.getState(survivor).init(gc, this);
		this.getState(game_over2).init(gc, this);
		this.enterState(menu);
	}

	public static void main(String[] args) {
		AppGameContainer appgc;
		try {
			appgc = new AppGameContainer(new Game(gamename));
			appgc.setDisplayMode(1024, 768, false); //false je ako ne zelimo full screen
			appgc.setTargetFrameRate(40);
			appgc.setShowFPS(false);
			appgc.start();
		} catch (SlickException e) {
			e.printStackTrace();
		}
	}


}
